package com.yunxiao.hfs.service;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by huangshengsen on 2017/8/17.
 */

public class ServiceManager {
    private static final ServiceManager INSTANCE = new ServiceManager();
    private Map<String, ServiceFactory> mServiceFactoryMap = new HashMap<>();

    private ServiceManager() {
    }

    public static ServiceManager getInstance() {
        return INSTANCE;
    }

    public void register(Class serviceClazz, ServiceFactory serviceFactory) {

    }

    public <T> T use(final Class<T> service) {
        return (T) mServiceFactoryMap.get(service.getSimpleName()).create();
    }


}
